<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%>
<%@ taglib uri="/struts-tags" prefix="s" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>博文分类列表</title>
<link href="${pageContext.request.contextPath}/css/yui.css" type="text/css"
	rel="stylesheet" />
<link href="${pageContext.request.contextPath}/css/style.css" type="text/css"
	rel="stylesheet" />

</head>
<body>
        <h3><input type="button" value="分类信息显示" onclick="show();" />
         <input type="button" value="添加分类"  onclick="add();"/></h3>
    <div id="show">
   <s:actionerror/> 
	<table>
		<tr>
			<th>编号</th>
			<th>分类名称</th>
			<th>创建时间</th>
			<th>操作</th>
		</tr>

		<c:forEach var="bv" items="${list}" varStatus="status">
			<!-- 隔行变色效果 -->
			<!-- 判断status.count是否为奇数,如果为奇数设置该行背景颜色为蓝色 -->
			<tr 
				<c:if test="${status.count % 2 == 1}">
					class = "odd"
				</c:if>
			>
				<td>${status.count}</td>
				<td>${bv.cname}</td>
				<td>${bv.createtime }</td>
				
				<td>&nbsp; 
			<%-- <a href="studentDisp?id=${student.sno}&name=${student.sname}">查看</a> --%>
			<!-- <a href="
				<c:url value="studentDisp">
					<c:param name="id" value="${student.sno}"/>
				</c:url>"
			>查看</a>
			&nbsp; -->
			<!-- 使用url标签构建由servlet路径与参数列表的拼接后的url路径(更便于维护) -->
			<a href="
				<c:url value="delBcategoryAction">
					<c:param name="bv.cid" value="${bv.cid}"/>
				</c:url>"
			 	onclick="return confirm('确定删除该学生?')"
			>删除</a>
			
			</td>
			</tr>
			
		</c:forEach>

	</table>
	</div>
	<!-- 添加 -->
	<div id="add">
	             <s:form action="addBcategoryAction" method="post">
	             <span>
	             <s:text name="分类名称:"/>
	             <s:textfield name="add"/>
	             </span>
	             <br/><br/>
	             <input type="submit" value="添加"/><input type="reset" value="重置"/>
	             </s:form>
	
	</div>
<script src="${pageContext.request.contextPath}/js/changebcategory.js" type="text/javascript"></script>
</body>
</html>